package Year22_Month03.day13;

import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            ArrayList<Integer> myArr = new ArrayList<>();
            int date = sc.nextInt();//记录要输入的日期
            myArr.add(1);
            //用来记录下标
            int count = 2;
            //用日期来循环
            for(int i = 1;i <= date;i++){
                for (int j = 0; j < myArr.size(); j++) {
                    if(myArr.get(j) >= 3){
                        //如果说 >= 3，那么就增加一只小兔子
                        myArr.add(1);
                    }
                    myArr.set(j,myArr.get(j) + 1);
                }
            }
            System.out.println(myArr.size());
        }
    }
}
